﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZX.SYS.Library.AdiDl.PageBusiness
{
    public abstract class Af_Factory
    {
        public Af_Factory() { }

        protected abstract string Description
        {
            set;
        }

        public abstract IPageBlock GetInstance(object o, string s);
    }

    public class PageState : Af_Factory
    {
        public PageState() { }
        static PageState() { }

        private static volatile IPageBlock InstanceBase=null;

        private static object obj = new object();

        /// <summary>
        /// 获取对应规则的显示权限
        /// </summary>
        /// <param name="o">this.Page</param>
        /// <returns></returns>
        public static IPageBlock GetInstanceBase(object o, string s)
        {
            if (InstanceBase == null)
            {
                lock (obj)
                {
                    if (InstanceBase == null)
                    {
                        InstanceBase = new PageState().GetInstance(o, s);
                    }
                }
            }
            return InstanceBase;
        }

        private string _Description;

        protected override string Description
        {
            set { this._Description = value; }
        }

        public override IPageBlock GetInstance(object o, string s)
        {
            return new Br_PageDefault(o, s);
        }



    }
}
